package model

const (
	LEAVING_MESSAGES = iota + 1
	COMPLAINT
	INQUIRY
	POST_SALE
	WANT_TO_BUY
)

type LeavingMessages struct { //留言
	BaseModel
	User        int32  `gorm:"type:int;index"`
	MessageType int32  `gorm:"type:int comment '留言类型：1(留言),2(投诉),3(询问),4(售后),5(求购)'"`
	Subject     string `gorm:"type:varchar(100) comment '主题'"`

	Message string `gorm:"type:varchar(200) comment '信息'"`
	File    string `gorm:"type:varchar(200) comment '附件'"`
}

func (LeavingMessages) TableName() string {
	return "leavingmessages"
}

type Address struct { //地址
	BaseModel
	User         int32  `gorm:"type:int;index"`
	Province     string `gorm:"type:varchar(10)"`
	City         string `gorm:"type:varchar(10)"`
	District     string `gorm:"type:varchar(20)"`
	Address      string `gorm:"type:varchar(20)"`
	SignerName   string `gorm:"type:varchar(20)"`
	SignerMobile string `gorm:"type:varchar(11)"`
}

func (Address) TableName() string {
	return "address"
}

type UserFav struct { //收藏
	BaseModel
	User  int32 `gorm:"type:int;index:idx_user_goods,unique"`
	Goods int32 `gorm:"type:int;index:idx_user_goods,unique"`
}

func (UserFav) TableName() string {
	return "userfav"
}
